package edu.xmut.kakamusic.viewmodel;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import java.util.ArrayList;
import java.util.List;

import edu.xmut.kakamusic.bean.entity.Line;

public class LineViewModel extends ViewModel {
    private MutableLiveData<List<Line>> lineList;

    public LineViewModel() {
        lineList = new MutableLiveData<>();
        String[] years = new String[]{"毕业生", "1-3年", "3-4年", "4-5年", "5-9年", "9-10年", "10年"};
        int[] salaries = {6000, 13000, 20000, 26000, 35000, 50000, 100000};
        List<Line> value = new ArrayList<>();
        for (int i = 0; i < years.length; i++) {
            value.add(new Line(years[i], salaries[i]));
        }
        lineList.setValue(value);
    }

    public LiveData<List<Line>> getLineList() {
        return lineList;
    }
}
